/*
 * ========================================================================
 *
 *       Filename:  card.h
 *
 *    Description:  This defines the classes for use as flashcards.
 *
 *        Version:  1.0
 *        Created:  05/10/2010 10:34:10 AM
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  Alex Avance (aa), aravance@gmail.com
 *        Company:  independent
 *
 * ========================================================================
 *
 * Copyright (C) 2010 Alex Avance
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-
 * 1307, USA.
 *
 * ========================================================================
 */
#ifndef _CARD_H_
#define _CARD_H_

#include "wx/string.h"
#include "statinfo.h"

class FlashCard;

bool operator== ( const FlashCard &one, const FlashCard &two );
bool operator!= ( const FlashCard &one, const FlashCard &two );
bool operator< ( const FlashCard &one, const FlashCard &two );
bool operator<= ( const FlashCard &one, const FlashCard &two );
bool operator> ( const FlashCard &one, const FlashCard &two );
bool operator>= ( const FlashCard &one, const FlashCard &two );

/**************************************************************************
Class Name: FlashCard
Description: This has a front and a back and ways to access it.
**************************************************************************/
class FlashCard
{
public:
  typedef wxString InfoT;

  // ====================  LIFECYCLE     ================================
  FlashCard ();
  FlashCard ( const FlashCard &other );
  FlashCard ( const InfoT &front, const InfoT &back );

  // ====================  ACCESSORS     ================================
  InfoT& Front ();
  const InfoT& Front () const;
  const InfoT& GetFront () const;

  InfoT& Back ();
  const InfoT& Back () const;
  const InfoT& GetBack () const;

  // ====================  MUTATORS      ================================
  const InfoT& SetFront ( const InfoT &front );
  const InfoT& SetBack ( const InfoT &back );

  // ====================  OPERATORS     ================================
  const FlashCard& operator= ( const FlashCard &other );

  friend bool operator== ( const FlashCard &one, const FlashCard &two );
  friend bool operator!= ( const FlashCard &one, const FlashCard &two );
  friend bool operator< ( const FlashCard &one, const FlashCard &two );
  friend bool operator<= ( const FlashCard &one, const FlashCard &two );
  friend bool operator> ( const FlashCard &one, const FlashCard &two );
  friend bool operator>= ( const FlashCard &one, const FlashCard &two );

  // ====================  DATA MEMBERS  ================================
protected:
  InfoT m_Front;
  InfoT m_Back;
}; // ----- end of class FlashCard -----


/**************************************************************************
Class Name: StudyCard
Description: This defines a studycard inheriting FlashCard and StatInfo.
**************************************************************************/
class StudyCard: public FlashCard, public StatInfo
{
public:
  typedef FlashCard::InfoT InfoT;
  typedef StatInfo::StatT StatT;

  // ====================  LIFECYCLE     ================================
  StudyCard ();
  StudyCard ( const StudyCard &other );
  StudyCard ( const FlashCard &card,
              const StatT &right= 0, const StatT &wrong= 0 );
  StudyCard ( const InfoT &front, const InfoT &back,
              const StatT &right= 0, const StatT &wrong= 0 );

  // ====================  OPERATORS     ================================
  StudyCard& operator= ( const FlashCard &card );
  StudyCard& operator= ( const StudyCard &other );
}; // ----- end of class StudyCard -----

#endif // _CARD_H_

